package cn.kuporo.seckill.common.exception;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

/**
 * @author: kuporo
 * @since: 2025/7/6
 * @description: 自定义异常
 */
@Getter
@Setter
public class SeckillException extends RuntimeException{
    /**
     * 异常码
     */
    private String errorCode;

    /**
     * 错误信息
     */
    private String errorMessage;

    public SeckillException(BaseExceptionInterface baseExceptionInterface) {
        this.errorCode = baseExceptionInterface.getErrorCode();
        this.errorMessage = baseExceptionInterface.getErrorMessage();
    }

    public SeckillException(BaseExceptionInterface baseExceptionInterface,Throwable throwable) {
        super(baseExceptionInterface.getErrorMessage(),throwable);
        this.errorCode = baseExceptionInterface.getErrorCode();
        this.errorMessage = baseExceptionInterface.getErrorMessage();
    }

    public SeckillException(String errorCode,String errorMessage) {
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }




}
